#!/bin/sh

if [ -f .$2_version ]; then
	mv .$2_version .$2_version.old
fi

MAJOR_VER=`cat $1/version.h | grep "#define MAJOR_VERSION" | awk -F\  '{print $3}'`
MINOR_VER=`cat $1/version.h | grep "#define MINOR_VERSION" | awk -F\  '{print $3}'`
BUILD_NUM=`cat $1/version.h | grep "#define BUILD_NUMBER" | awk -F\  '{print $3}'`
echo -e "$MAJOR_VER.$MINOR_VER.$BUILD_NUM" > .$2_version
